﻿using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;

namespace CarterWechatServer.WebApi.App_Start
{
    /// <summary>
    /// Json字符格式配置
    /// </summary>
    public class JsonFormatConfig
    {
        public static void Register(HttpConfiguration configuration)
        {
            configuration.Formatters.JsonFormatter.SerializerSettings = new Newtonsoft.Json.JsonSerializerSettings()
            {
                ContractResolver = new CamelCasePropertyNamesContractResolver(),//小驼峰命名
                DateFormatString = "yyyy-MM-dd HH:mm:ss"//格式化日期
            };
        }
    }
}